package Java面试周阳.JVM;

public class HelloGC2 {
    public static void main(String[] args) {
        // 返回Java虚拟机中内存的总量
        long totalMemory = Runtime.getRuntime().totalMemory();

        // 返回Java虚拟机中试图使用的最大内存量
        long maxMemory = Runtime.getRuntime().maxMemory();

        System.out.println("TOTAL_MEMORY(-Xms) = " + totalMemory + "(字节)，" + (totalMemory/(double)1024/1024) + "MB");
        System.out.println("MAX-MEMORY(-Xmx) = " + maxMemory + "(字节)，" + (maxMemory/(double)1024/1024) + "MB");
    }
}
